from datetime import datetime

from sqlalchemy import ForeignKey
from sqlalchemy.orm import Mapped, relationship, mapped_column
from .base import Base, str_150


class Book(Base):
    __tablename__ = 'books_new'

    title: Mapped[str_150]
    count: Mapped[int] = mapped_column(default=1)
    # release_date: Mapped[datetime.date]
    author_id: Mapped[int] = mapped_column(ForeignKey("authors.id", ondelete="CASCADE"))
